<?php

namespace app\validate;
use app\BaseValidate;
class Article extends BaseValidate
{
    protected $rule = [
        'title'  => 'require|length:2,20|unique:task',
        'category_id'  => 'require|number',
        'sort'  =>  'number'
    ];

    protected $message  =   [
        'title.require' => '文章标题必须填写',
        'title.length' => '文章标题长度2至20个字符',
        'title.unique' => '文章标题不能重复',
        'category_id.require' => '请选择文章类',
        'category_id.number' => '请选择文章类',
        'sort.number' => '排序必须是数字'
    ];
}
